package leetcode.method.dynamic_programming;

import java.util.ArrayList;
import java.util.List;

public class Program79ClimbStair {

    public Program79ClimbStair() {
    }

    public int climbStairs(int n) {
        if (n == 0 ) {
            return 0;
        }
        if (n == 1) {
            return 1;
        }
        int[] record = new int[n + 1];
        record[0] = 1;
        record[1] = 1;
        for (int i = 1; i < n; i++) {
            record[i + 1] = record[i - 1] + record[i];
        }
        return record[n];
    }

    public static void main(String[] args) {
        Program79ClimbStair myStack = new Program79ClimbStair();
        System.out.println(myStack.climbStairs(2));
        System.out.println(myStack.climbStairs(3));
        System.out.println(myStack.climbStairs(4));
        System.out.println(myStack.climbStairs(5));
        System.out.println(myStack.climbStairs(45));
    }
}
